function showLables(books) {
    let booksmark = JSON.parse(books);
    //获取页面中的元素
    let bookList = document.getElementById('bookmarks');
    booksmark.forEach(obj => {
        createBookmark(bookList, obj);
    })
}

function createBookmark(parent, obj) {

    //这是一个目录下面有其它的标签
    if (obj.urls != undefined) {
        let li = document.createElement('li');
        li.innerHTML = `<h3 id="${obj.id}">${obj.title}</h3>`;
        parent.appendChild(li);
        let ul = document.createElement('ol');
        li.appendChild(ul);
        obj.urls.forEach(url => {
            createBookmark(ul, url);
        })

    }
    //这是一个单独的标签
    if (obj.url != undefined && obj.url != "") {
        let li = document.createElement('li');
        parent.appendChild(li);
        li.innerHTML = `<img src="${obj.icon}" class="favicon" /> <a href="${obj.url}" id="${obj.id}" title="${obj.title}">${obj.title}</a>`;

    }
}